﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Aga.Psad.Backend.Repositories;
using Aga.Psad.Backend.Entities;

namespace Aga.Psad.Web
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        public void Submit(object sender, EventArgs e)
        {
            UsuariosRepository repo = new UsuariosRepository();
            Usuario usuario = repo.GetByUsername(this.username.Text.Trim());
            if (usuario != null)
                Response.Redirect("Default.aspx");
            else
                this.lblErrorMessage.Text = "Nombre de usuario o password incorrecto";
        }
    }
}
